home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
compat.exe
/
COMPAT.DOC
< prev
next >
Wrap
Text File
|
1992-06-26
|
2KB
|
58 lines
About Unit COMPAT:
TFuncBox is a TDialog descendant which can execute your old Turbo Pascal
functions without TurboVision modifications.
The function must be of this type:
function TestFunc : word; far;
begin
...
call your old TP procedures here
...
end;
It MUST be declared as a FAR function. Normally, you would write your
function to run your old units.
TFuncBox is initialized and executed in a manner similar to an ordinary
dialog box except that it includes an additional parameter, which is a
pointer to your function:
var R: TRect; D: PFuncBox;
begin
R.Assign (,,,);
D := New (PFuncBox, Init (R, 'Test', @TestFunc));
DeskTop^.ExecView (D); { executes function TestFunc() }
Dispose (D, Done);
end;
The result of the function (eg: TestFunc) would be returned by ExecView.
Unlike TDialog, this function will allow a return of any word value. But be
prepared for a return of cmCancel if ValidView() fails.
Regular TP I/O procedures are window-sensitive, eg: GotoXY(), ClrScr(), etc.
If your old program uses screen procedures that are not window sensitive (or
for executing another program within your own), you can open one of these
windows as oversized (to eliminate the border), and then execute it from the
application instead of the desktop:
Application^.GetExtent (R);
R.Grow (1,1);
Application^.ExecView (New (PFuncBox, Init (R, '', @TestFunc)));
Both of these configurations are demonstrated in RUNTEST.PAS.
This is a free public domain unit. Don't let it encourage you to veer too
far from the TurboVision framework. This should only be used as a stepping
stone in a progression toward full TurboVision programs.
Randolph Beck
P.O. Box 56-0487
Orlando, FL 32856